package cn.exrick.xboot.modules.transport.baoxian.config;

import lombok.Getter;

@Getter
public enum InsuranceStatus {

    PENDING_SURRENDER(216, "待退保"),
    TO_BE_REVIEWED(61, "待审核"),
    EFFECTIVE(62, "已生效"),
    REJECTED(63, "已拒保"),
    CANCELLED(64, "已撤销"),
    NEED_MODIFICATION(65, "需修改"),
    SURRENDERED(66, "已退保"),
    UNDER_APPROVAL(901, "报批中"),
    APPROVED(902, "报批通过"),
    RECORDED(903, "报备"),
    TEMPORARY_SAVE(909, "暂存");

    private final Integer code;
    private final String desc;

    InsuranceStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    //通过code获取desc
    public static String getDescByCode(Integer code) {
        for (InsuranceStatus status : InsuranceStatus.values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }
}
